import { request } from '@/shared/axios';
import { getUserAuth } from '@/utils/login.ts';

interface ParamsT {
  feedbackPageUrl: string;
  efficiency: number;
  accuracy: number;
  completeness: number;
  usability: number;
}

// 文档反馈

export const docNpsApi = (params: ParamsT) => {
  return request.post('/api-dsapi/query/doc/nps/openubmc', params, {
    headers: {
      token: getUserAuth(),
    },
    skipAuth: true,
    handleError: (response) => {
      if (response?.data?.data?.feedbackText) {
        response.data.msg = response?.data?.data?.feedbackText;
      }
    },
  });
};